package com.lzhsite.technology.designPattern.mediator.DepartmentDemo;

public class ClientForDepartmentDemo
{
    public static void main(String[] args)
    {
        DepartmentUserMediatorImplement mediator = DepartmentUserMediatorImplement.getInstance();
        Department department1 = new Department();
        department1.setDepartmentId("Department1");
        Department department2 = new Department();
        department2.setDepartmentId("Department2");
        User user1 = new User();
        user1.setUserId("User1");
        User user3 = new User();
        user3.setUserId("User3");
        System.out.println("撤销部门前-----");
        mediator.showUsersDepartment(user1);
        department1.deleteDepartment();
        System.out.println("撤销部门后-----");
        mediator.showUsersDepartment(user1);
        System.out.println();
        System.out.println("人员离职前-----");
        mediator.ShowDepartmentUsers(department2);
        user3.dimission();
        System.out.println("人员离职后-----");
        mediator.ShowDepartmentUsers(department2);
    }
}
